package top.noteday.controller;

import java.util.List;
import java.util.Date;
import entity.Page;
import entity.result.EntityResult;
import org.springframework.beans.factory.annotation.Autowired;
import entity.result.PageResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.PostMapping;
import entity.user.*;
import top.noteday.impl.UserServiceImpl;

// TODO 修改 value
@RestController
@RequestMapping(value = "/xxx/xxx")
public class UserServiceController {

    @Autowired
    private UserServiceImpl userService;

    /**
     * 查询一个
     */
    @PostMapping(value = "/selectById")
    public User selectById(@RequestParam("id") Integer id) {
        return userService.selectById(id);
    }

    /**
     * 登录
     */
    @PostMapping(value = "/login")
    public EntityResult<UserDto> login(@RequestBody UserVo vo) {
        return userService.login(vo);
    }

    /**
     * 分页查询
     */
    /*
    @PostMapping(value = "/selectUser")
    PageResult<UserDto> selectUser(@RequestBody UserVo userVo) {
        return userService.selectUser(userVo);
    }
    */
}
